home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / GLUT-3.7 / LIB / GLUT / glut_modifier.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-12  |  766 b   |  32 lines

  1.  
  2. /* Copyright (c) Mark J. Kilgard, 1994. */
  3.  
  4. /* This program is freely distributable without licensing fees 
  5.    and is provided without guarantee or warrantee expressed or 
  6.    implied. This program is -not- in the public domain. */
  7.  
  8. #include "glutint.h"
  9.  
  10. /* CENTRY */
  11. int APIENTRY
  12. glutGetModifiers(void)
  13. {
  14.   int modifiers;
  15.  
  16.   if(__glutModifierMask == (unsigned int) ~0) {
  17.     __glutWarning(
  18.       "glutCurrentModifiers: do not call outside core input callback.");
  19.     return 0;
  20.   }
  21.   modifiers = 0;
  22.   if(__glutModifierMask & (ShiftMask|LockMask))
  23.     modifiers |= GLUT_ACTIVE_SHIFT;
  24.   if(__glutModifierMask & ControlMask)
  25.     modifiers |= GLUT_ACTIVE_CTRL;
  26.   if(__glutModifierMask & Mod1Mask)
  27.     modifiers |= GLUT_ACTIVE_ALT;
  28.   return modifiers;
  29. }
  30.  
  31. /* ENDCENTRY */
  32.